package tech.aistar.service.impl.applyTouristService;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tech.aistar.entity.User.Register;
import tech.aistar.entity.authordis.UserTable;
import tech.aistar.entity.daoyou.GuideApply;
import tech.aistar.entity.daoyou.UserIdcard;
import tech.aistar.mapper.EditNotesMapper;
import tech.aistar.mapper.applyTourist.ApplyTouristMapper;
import tech.aistar.mapper.userLoginAndRegister.UserRegister;
import tech.aistar.service.applyTouristService.IApplyTouristService;

/**
 * Created by lenovo on 2019/10/5.
 */
@Service
@Transactional
public class ApplyTouristServiceImpl implements IApplyTouristService{

    @Autowired
    private ApplyTouristMapper applyTouristMapper;


    @Override
    public void insert(String address, String phone, Integer userId, String name, String birthplace, String sex) {
        applyTouristMapper.insert(address,phone,userId,name,birthplace,sex);
    }

    @Override
    public UserTable findByPhone(String phone) {
        UserTable user = applyTouristMapper.findByPhone(phone);
        return user;
    }

    @Override
    public void insertregister(String phoneNumber, String email,String ver_code) {
        applyTouristMapper.insertregister(phoneNumber,email,ver_code);

    }

    @Override
    public Register findByCode(String Code, String phoneNumber) {
        Register user = applyTouristMapper.findByCode(Code,phoneNumber);
        return user;
    }

    @Override
    public UserTable findId(String phone) {
        UserTable user = applyTouristMapper.findId(phone);
        return user;
    }

    @Override
    public void save(Integer userId, String name, String address, String Birth, String IDCard, String nation, String sex) {
        applyTouristMapper.save(userId,name,address,Birth,IDCard,nation,sex);
    }

    @Override
    public UserIdcard findById(Integer userId) {
        UserIdcard user = applyTouristMapper.findById(userId);
        return user;
    }

    @Override
    public GuideApply findGuideId(String name) {
        GuideApply user = applyTouristMapper.findGuideId(name);
        return user;
    }

    @Override
    public void saveGuideInfo(Integer guideId, String photo, String profile) {
        applyTouristMapper.saveGuideInfo(guideId,photo,profile);
    }

    @Override
    public UserIdcard findUser(String name) {
        UserIdcard user = applyTouristMapper.findUser(name);
        return user;
    }


}
